﻿<!DOCTYPE html>

<html>
<head runat="server">
    <title>进度条</title>
    <script src="~/Scripts/jquery-1.8.2.js"></script>
    <script src="~/Scripts/jquery.signalR-1.1.4.min.js"></script>
    <script src="~/signalr/hubs"></script>
</head>
<body>
    <div id="loading" style="width: 0%;">Loading</div>
    <input id="submit" type="button" value="Start" />

    <script>
        (function () {

            //接收信息
            var curHub = $.connection.curHub;//对应后台的类CurHub
            curHub.client.notify = function (msg) {
                $("#loading").css({ "background-color": "blue", "width": Number(msg) + "%" });
            };
            $.connection.hub.start().done(function () {
                curHub.server.setRecGroup("clientId");//设置接收组,该方法对应后台的类CurHub的SetRecGroup
            });

            $("#submit").click(function () {
                $.get("../Base/fnProgressBar", function () { });
            });

        })();
    </script>
</body>
</html>  